package com.ling.service;

import com.ling.dao.BookMapper;
import com.ling.pojo.Admin;
import com.ling.pojo.Books;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    //    service层调dao层
    @Resource
    private BookMapper bookMapper;
    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }


    public int deleteBookByid(int id) {
        return bookMapper.deleteBookByid(id);
    }


    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }


    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }


    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    public Books queryBookByName(String car_number) {
        return bookMapper.queryBookByName(car_number);
    }

    public Books userqueryBookByName(String car_number) {
        return bookMapper.userqueryBookByName(car_number);
    }

    @Override
    public List<Books> queryAllCount() {
        return bookMapper.queryAllCount();
    }


}
